#include "Vector.h"

Vector::Vector(const float _x, const float _y, const float _z) :
x(_x), y(_y), z(_z)
{
  //ctor
}

Vector::Vector(const Vector& copy) :
x(copy.x), y(copy.y), z(copy.z)
{
}

Vector::~Vector()
{
  //dtor
}

float Vector::dotProduct(const Vector& v1, const Vector& v2)
{
	return v1.x * v2.x + v1.y * v2.y + v1.z * v2.z; 
}

Vector Vector::crossProduct(const Vector& v1, const Vector& v2)
{
	return Vector(v1.y*v2.z - v1.z*v2.y, v1.z*v2.x - v1.x*v2.z, v1.x*v2.y - v1.y*v2.x);
}

float Vector::getSigma(void) const
{
	return acos(dotProduct(Vector(x, 0, z), Vector(1, 0, 0)) / Vector(x, 0, z).getLength());
}

float Vector::getGamma(void) const
{
	return acos(dotProduct(Vector(x, y, 0), Vector(1, 0, 0)) / Vector(x, y, 0).getLength());
}

std::ostream& operator<<(std::ostream& ostr, const Vector& v) 
{ 
  return ostr << "x: " << v.x << " y: " << v.y << " z: " << v.z; 
} 
